package mvpdemo.huan.com.writenumber;

import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends Activity {

    static boolean isPlay=true; //设置音乐播放状态变量

    MediaPlayer mediaPlayer;  //定义音乐播放器对象

    Button music_btn;   //定义控制音乐播放器按钮


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        music_btn=(Button)findViewById(R.id.btn_music);

        PlayMusic();

    }

    private void PlayMusic() {
        mediaPlayer=MediaPlayer.create(this,R.raw.music0);
        mediaPlayer.setLooping(true);
        mediaPlayer.start();
    }

    public void OnPlay(View v){  //单击事件 进入选择数字界面
        //当前界面跳转至选择数字界面
        startActivity(new Intent(MainActivity.this,SelectActivity.class));
    }

    public void OnAbout(View v){
        startActivity(new Intent(MainActivity.this,AboutActivity.class));
    }


}
